﻿jQuery.validator.addMethod("zip", function (value, element) {
    return this.optional(element) || /^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$/i.test(value);
}, "Invalid Zip");


jQuery.validator.addMethod("checkuser", function (value, element) {
    return this.optional(element) || (function () {
        $.ajax({
            dataType: "json",
            url: "/AjaxPort.aspx?model=BoUser&action=UserNameAvailable&emailAddress=" + value,
            success: function (data) {
                return data;
            }
        });
    })();
}, "Already Taken");  